﻿using System;
using System.Collections.Generic;
using BotonJXC.Entity;
using PaymentDAO = BotonJXC.DAO.PaymentDAO;
using BotonJXC.Util;
using NHibernate.Criterion;

namespace BotonJXC.BLL
{
    public class PaymentBLL : BaseBLL<PaymentDAO, Payment, int>
    {
        public PaymentBLL()
        {
        }

        public PageModel<Payment> Find(string paymentName, int start, int count)
        {
            List<ICriterion> criterions = new List<ICriterion>();
            if (!string.IsNullOrEmpty(paymentName))
            {
                criterions.Add(Restrictions.Like("PaymentName", paymentName, MatchMode.Anywhere));
            }
            return Dao.FindByPage(criterions.ToArray(), null, start, count);
        }
    }
}